package org.hbgl.geoentity.admin.task;

import org.hbgl.geoentity.admin.web.BaseController;
import org.hbgl.geoentity.db.service.DicService;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class AdminTaskStartupRunner implements ApplicationRunner {

    // @Resource
    // private TaskService taskService;
    @Resource
    private DicService dicService;

    @Override
    public void run(ApplicationArguments args) {
        // 将数据字典加载到缓存中
        BaseController.addressAll = dicService.selectAddressAll();
        BaseController.unitTypeAll = dicService.selectUnitTypeAll();
        BaseController.tradeAll = dicService.selectTradeAll();
    }

}
